<template>
    <div class="taskDispose">
      <el-dialog
        :title="taskType==1?'任务作废':'任务打回'"
        :visible.sync="dialogTableVisible"
        :close-on-click-modal="false"
        :before-close="close"
        width="500px">
        <table class="table" border="1" rules="all">
          <tr>
            <td class="title">下次处理时间</td>
            <td>
              <el-date-picker
                v-model="disposeDate"
                type="date"
                placeholder="选择日期">
              </el-date-picker>
            </td>
          </tr>
          <tr>
            <td class="title">任务编号</td>
            <td><span class="content">{{form.taskCode}}</span></td>
          </tr>
          <tr>
            <td class="title">{{taskType==1?'作废原因':'打回原因'}}</td>
            <td>
              <el-input v-model="form.reason" size="small" type="textarea" :rows="3" placeholder="请输入原因"></el-input>
            </td>
          </tr>
        </table>
        <span slot="footer" class="dialog-footer">
          <el-button size="mini" type="primary" @click="sumbit">确定</el-button>
        </span>

      </el-dialog>
    </div>
</template>

<script>
    export default {
      props:{
        taskData:'',
        taskType:'',
      },
      name: "taskDispose.vue",
      data(){
          return{
            dialogTableVisible:true,
            form:{
              disposeDate:'',
              taskCode:this.taskData.taskCode,
              reason:'',
            },
            disposeDate:'',//处理时间
          }
      },
      methods:{
        close(){
          this.$emit('taskChange')
        },
        sumbit(){
          if(!this.disposeDate){
            this.$message.error('请选择下次处理时间！')
            return
          }
          if(!this.form.reason){
            this.$message.error('请填写原因！')
            return
          }
          this.$message.success(this.taskType==1?'任务作废成功！':'任务打回成功！')
          this.$emit('taskChange',this.selectData)
        }
      }
    }
</script>

<style lang="scss">
.taskDispose{
  .table{
    margin-left: 15px;
    border: 1px solid #cccccc;
    color: #606266;
    font-size: inherit;
    .el-input--medium .el-input__inner,.el-textarea .el-textarea__inner{
      border: none;
    }
    tr{
      .title{
        width: 150px;
        text-align: center;
      }
      td{
        width:300px;
        line-height: 35px;
        .content{
          padding-left:10px
        }
      }
    }
  }
}
</style>
